const express = require('express');
const mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/taobao');
const db = mongoose.connection;

db.on('error',function(){
	console.log('数据库链接失败');
})
db.once('open',function(){
	console.log('数据库链接成功');
})


module.exports = db; 